/*
 * test.cpp
 *
 *  Created on: 2013-1-17
 *      Author: heqiu
 */

#include "myall.h"

MyLock g_lock;
class MyThread: public ThreadUnit {
public:
	void run() {
		while (true) {
			g_lock.lock();
			int i = rand();
			printf("begin....%d\n", i);
			SDL_Delay(1000);
			printf("end....%d\n", i);
			g_lock.unlock();
		}
	}
};

int main(int argc, char ** argv) {
	MyThread s1;
	s1.start();
	MyThread s2;
	s2.start();
	MyThread s3;
	s3.start();
	SDL_Delay(6000);
	return 0;
}

